// A-S-M team
// Project: BattleCity
// Created: 23.03.2011
// Last change: 24.03.2011
// Description: implementation class-singleton "Sounder" play all sounds of game

#include "sounder.h"
#include "consts.h" // for constant NULL
#include "resources.h"

Sounder * Sounder::p_instance = NULL;

void Sounder::playLevelStart()
{
	CL_SoundBuffer vorbis("level_start", &Resources::getInstance()->getManager());
	vorbis.play(false);
}

void Sounder::playTankMoving(bool play)
{
	if (play) 
	{
		if (!_tank_moving_playback.is_playing()) 
			_tank_moving_playback.play();
	}
	else
	{
		if (_tank_moving_playback.is_playing())
			_tank_moving_playback.stop();
	}
}

void Sounder::playTankIdle(bool play)
{
	if (play) 
	{
		if (!_tank_idle_playback.is_playing()) 
			_tank_idle_playback.play();
	}
	else
	{
		if (_tank_idle_playback.is_playing())
			_tank_idle_playback.stop();
	}
}